<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:form id="frmViewClaim">
        <f:view>
            <p:contextMenu id="ctViewClaim" for="dlgViewClaim">
                <p:menuitem value="New"
                            icon="ui-icon-search"
                            oncomplete="wgCreateCalim.show();"
                            update=":frmCreateCalim:dlgCreateCalim"
                            rendered="#{system.employee}"
                            />
                <p:menuitem value="View Details"
                            icon="ui-icon ui-icon-arrowreturnthick-1-e"
                            oncomplete="wgEditCalim.show();"
                            update=":frmEditCalim:dlgEditCalim"
                            >
                </p:menuitem>
                <p:submenu label="Export" icon="ui-icon-extlink">
                    <p:submenu label="All Data">
                        <p:menuitem value="To Excel 2010"  ajax="false"  >
                            <p:dataExporter type="xls" target="dtViewClaim"  fileName="Claim" />
                        </p:menuitem>
                        <p:menuitem value="To XML" ajax="false" >
                            <p:dataExporter type="xml" target="dtViewClaim" fileName="Claim"/>
                        </p:menuitem>
                        <p:menuitem value="To PDF" ajax="false" >
                            <p:dataExporter type="pdf" target="dtViewClaim" fileName="Claim"/>
                        </p:menuitem>
                    </p:submenu>
                    <p:submenu label="All Data in Page">
                        <p:menuitem value="To Excel 2010" ajax="false" >
                            <p:dataExporter type="xls" target="dtViewClaim" fileName="Claim" pageOnly="true" />
                        </p:menuitem>
                        <p:menuitem value="To XML" ajax="false" >
                            <p:dataExporter type="xml" target="dtViewClaim" fileName="Claim" pageOnly="true"/>
                        </p:menuitem>
                    </p:submenu>
                </p:submenu>
            </p:contextMenu>
            <p:focus context="dtViewClaim"/>
            <p:dialog id="dlgViewClaim"
                      widgetVar="wgViewClaim"
                      header="Claim Information Management"
                      draggable="true"
                      showEffect="clip"
                      hideEffect="clip">
                <p:dataTable id="dtViewClaim"
                             value="#{calimManagement.list}"
                             rowKey="#{item.claimId}"
                             selection="#{calimManagement.selectClaim}"
                             selectionMode="single"
                             var="item"
                             filteredValue="#{calimManagement.filteredList}"
                             paginator="true"
                             rows="5">


                    <p:column sortBy="#{item.billNumber}"
                              filterBy="#{item.billNumber}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="BillNumber"/>
                        </f:facet>
                        <h:outputText value="#{item.billNumber}"/>
                    </p:column>
                  
                    <p:column sortBy="#{item.dateSend.toLocaleString()}"
                              filterBy="#{item.dateSend.toLocaleString()}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="DateSend"/>
                        </f:facet>
                        <h:outputText value="#{item.dateSend.toLocaleString()}">
                        </h:outputText>
                    </p:column>
                    <p:column sortBy="#{item.dateProcesse.toLocaleString()}"
                              filterBy="#{item.dateProcesse.toLocaleString()}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="DateProcesse"/>
                        </f:facet>
                        <h:outputText value="#{item.dateProcesse.toLocaleString()}">
                        </h:outputText>
                    </p:column>
                    <p:column sortBy="#{item.claimMoney}"
                              filterBy="#{item.claimMoney}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="ClaimMoney"/>
                        </f:facet>
                        <h:outputText value="#{item.claimMoney}"/>
                    </p:column>
                    <p:column sortBy="#{item.claimStatus}"
                               filterBy="#{item.claimStatus}"
                               filterMatchMode="exact"
                               filterOptions="#{calimManagement.statusOption}">
                        <f:facet name="header" >
                            <h:outputText value="ClaimStatus"/>
                        </f:facet>
                        <h:outputText value="#{item.claimStatus}"/>
                    </p:column>
                    <p:column sortBy="#{item.users.userName}"
                              filterBy="#{item.users.userName}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Users"/>
                        </f:facet>
                        <h:outputText value="#{item.users.userName}"/>
                    </p:column>
                    <p:column sortBy="#{item.hospital.hospitalName}"
                              filterBy="#{item.hospital.hospitalName}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Hospital"/>
                        </f:facet>
                        <h:outputText value="#{item.hospital.hospitalName}"/>
                    </p:column>
                    <p:column sortBy="#{item.claimType.claimTypeName}"
                              filterBy="#{item.claimType.claimTypeName}"
                              filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="ClaimType"/>
                        </f:facet>
                        <h:outputText value="#{item.claimType.claimTypeName}"/>
                    </p:column>
                </p:dataTable>
            </p:dialog>
        </f:view>
    </h:form>
</html>
